package com.springboot.exception;

import com.springboot.enums.ErrorEnum;
import lombok.Getter;

@Getter
public class MyException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer code;

    public MyException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public MyException(ErrorEnum errorEnum) {
        super(errorEnum.getMsg());
        this.code = errorEnum.getCode();
    }

}